<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="id" lang="id">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title> 
	<script type="text/javascript">
		  function somescript() {
		    document.getElementById('clickOnLoad').click();
		  }
		  function setCheckedParents() {
			   var listLastChilds = document.getElementsByTagName('input');
			   for(var i = 0; listLastChilds != null && i < listLastChilds.length; i ++){
				   if(listLastChilds[i].getAttribute('ite') != null && listLastChilds[i].getAttribute('ite') == 't'){
					   rolesProcess(listLastChilds[i]);			   
				   }
			   }
		  }
	</script>
</head>
<body onload="setCheckedParents()">
	<html:form action="/roleGroup.do">
	<div class="outerbox">
		<div class="mainHeading">
			<div class=""
				style="width: 280px; height: 32px; background: url(images/formTitleBackground.png) no-repeat top right; font-color: #CC0000;">
				<h2 class="formTitle">ROLE GROUPS</h2>
			</div>
		</div> 
	</div>
	<div style="background-color: white;"  class="outerbox">
			<div id="formcontent" style="padding-left: 5px;">
				<br class="clear" /> 
				<html:select property="selectedUserRoles" style="width:200px; padding-left: 5px;" onchange="javascript: postParams('');">
					<html:optionsCollection property="listUserRoles" label="displayName" value="id" />
				</html:select>
				<br class="clear" />
				<div id="treecontrol" style="display: block;">
					<a style="color:blue;padding-left: 5px;" href="#" title="Collapse the entire tree below"> Collapse All</a>
					|
					<a id="clickOnLoad" style="color:blue;" href="#" title="Expand the entire tree below"> Expand All</a>
					|
					<a style="color:blue;" href="#" title="Toggle the tree below, opening closed branches, closing open branches">Toggle All</a>
				</div> 
				<div id="roleGroup">
					<bean:write filter="false" name="roleGroup" property="htmlTree"/>
					<a style="color:red;"><bean:write property="message" name="roleGroup"/></a><br/>
					<html:text property="roleGroupName">Roles group name:</html:text>
					<logic:equal name="roleGroup" property="selectedUserRoles" value="0">
						<html:submit property="btnAdd">Add</html:submit> 
					</logic:equal>
					<logic:notEqual name="roleGroup" property="selectedUserRoles" value="0">
						<html:submit property="btnEdit">Update</html:submit>
					</logic:notEqual>
					<br/>
				</div>
			</div>
	</div>
	</html:form> 
</body>
</html>